class Solution(object):
    def isPalindrome(self, x):
        """
        :type x: int
        :rtype: bool
        """
        if x<0:return False
        def getNth(n):
            base = 10**n
            ret = (x//base)%10
            return ret
        def getTotal():
            tmp = x
            n = 1
            while tmp>=10:
                n+=1
                tmp//=10
            return n
        begin = 0
        end = getTotal()-1
        while begin<end:
            if getNth(begin)!=getNth(end):
                return False
            begin+=1
            end-=1
        return True

print(Solution().isPalindrome(1001))